<?php if (!defined('THINK_PATH')) exit();?><html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
  <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> 
  <meta name="format-detection" content="telephone=no">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <link rel="stylesheet" type="text/css" href="/Public/css/petinfo.css">
    <script type="text/javascript" src="/Public/js/jquery-1.11.3.min.js"></script>
</script> 
  <title>宠物信息</title>
</head>
<body>
<div class="z_index">
  
</div>
<div class="img_z_index">
  
</div>

<div class="top_info"><span class="re_hui"><<返回</span><span>小宠の相册</span><span class="add_info"><a href="<?php echo U('Index/photo_add');?>">添加故事</a></span></div>

<?php if($write_info != null): if(is_array($write_info)): $k = 0; $__LIST__ = $write_info;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($k % 2 );++$k;?><div class="clear"></div>
<div class="content_info">
	<div>NO.<?php echo ($k); ?></div>
    <div><?php echo ($vo["w_wtime"]); ?></div>
    <div><?php echo ($vo["w_content"]); ?></div>
    <div class="content_info_img_all">
      <?php if(is_array($vo["w_pic"])): $i = 0; $__LIST__ = $vo["w_pic"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><img src="<?php echo ($v); ?>" class="content_info_img"><?php endforeach; endif; else: echo "" ;endif; ?>
    </div>
<!-- <a href="<?php echo U('Index/use_gongneng',array('w_id'=>$vo['w_id']));?>"><div class="xiugai_info"><img src="/Public/img/u=2812557373,106796779&fm=23&gp=0.jpg" width="20px;" style="position: relative; top:5px;">修改信息</div>    </a> -->
<div class="clear"></div>
<div class="petInfo_info_set">
  <a href="<?php echo U('Index/use_gongneng',array('w_id'=>$vo['w_id']));?>"><div class="petInfo_info_set_bo save_petinfo" style="margin-top: 0px;"> 修改</div></a>
  <div class="petInfo_info_set_bo delete_petinfo" style="margin-top: 0px;" w_id="<?php echo ($vo['w_id']); ?>"> 删除</div>
</div>

</div>

  <div class="clear"></div>
<hr/><?php endforeach; endif; else: echo "" ;endif; ?>
<?php else: ?>
<div class="empty_font">
<div><img src="/Public/img/noinfo.png"></div>
<div class="font_info">还没有故事哦! 快点击右上角添加故事吧!</div>
</div><?php endif; ?>
<script type="text/javascript">
  $('.content_info_img').click(function(){
    var src=$(this).attr('src');
    var img='<img src='+src+'>';
    $('.img_z_index').append(img);
    $('.z_index').show();
  })
  $('.img_z_index').click(function(){
     $(this).text('');
     $('.z_index').hide();
  })


   $('.re_hui').click(function(){
    history.go(-1);
  })
</script>
<script type="text/javascript">
  $('.delete_petinfo').click(function(){
  if(!confirm("确定要删除数据吗？")){
    return;
  }
  var w_id=  $(this).attr('w_id');
  $.post("<?php echo U('Index/delete_write');?>",{w_id:w_id},function(data){
      if(data==100){
          alert('删除成功');
          history.go(0);
      }else{
         alert('删除失败');
      }
  });
  })
</script>
</body>
</html>